home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / pxewin.zip / PXDEF.HPP < prev    next >
Text File  |  1992-02-04  |  5KB  |  158 lines

  1. // PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
  2.  
  3. // PXDEF.HPP //
  4.  
  5. // Contents ----------------------------------------------------------------
  6. //
  7. //    This module contains definitions that are used throughout the PX
  8. //    engine class library.  The module definitions are:
  9. //
  10. //    1.  Create_Mode.  Indicates how the table is to be opened.
  11. //
  12. //    2.  PXEWIN_ERR.  These are error codes exclusive of PDOX Engine
  13. //        error codes and are added for PXEWIN error related problems.
  14. //
  15. //    3.  CLOSURE.  Indicates whether a specific entity is opened or
  16. //        closed.  This is useful for determining if a table or record
  17. //        buffer is opened or closed.
  18. //
  19. //    4.  DATES.  This structure is used for storing and retrieving date
  20. //        related fields from the Engine.
  21. //
  22. //    5.  Additional typedef's for DLL compatible pointer assignments.
  23. //
  24. // End ---------------------------------------------------------------------
  25.  
  26. // External Reference name for this header ---------------------------------
  27.  
  28. #ifndef PXDEF_HPP
  29.     #define PXDEF_HPP
  30.  
  31. // End ---------------------------------------------------------------------
  32.  
  33. // enum Create_Mode //
  34.  
  35. enum Create_Mode
  36. {
  37.     NOTEXISTS,            /* Use this only to bail out of
  38.                        loading a database */
  39.     EXISTS,                /* Use this mode code when opening
  40.                        a table that already exists */
  41.     OVERWRITE,            /* This will overwrite an existing
  42.                        table with a new one */
  43.     CREATE                /* Create a new table from scratch */
  44. };
  45.  
  46. // Description -------------------------------------------------------------
  47. //
  48. //    Use these mode codes to open a table in the proper mode.
  49. //
  50. // End ---------------------------------------------------------------------
  51.  
  52. // enum PXEWIN_ERR //
  53.  
  54. enum PXEWIN_ERR
  55. {
  56.     PXEWSUCCESS,            /* Successful operation */
  57.     PXEWERR_TBLNOTEXIST,        /* An attempt was made to open a
  58.                        table that does not exist */
  59.     PXEWERR_TBLEXIST,        /* An attempt was made to create a
  60.                        table that exists */
  61.     PXEWERR_COULDNTOPENTBL        /* Couldn't not open table */
  62. };
  63.  
  64. // Description -------------------------------------------------------------
  65. //
  66. //     These are a set of error codes that are unique to the PXEWIN
  67. //    library and are exclusive of the PXENGINE error codes.  The
  68. //    associated error is set in the PXError class.
  69. //
  70. // End ---------------------------------------------------------------------
  71.  
  72. Pchar EWinMsg[] =
  73. {
  74.     NULL,                /* PXWSUCCESS */
  75.     "This table does not exist.",    /* PXEWERR_TBLNOTEXIST */
  76.                     /* PXEWERR_TBLEXIST */
  77.     "Cannot Create a Table that Exists.",
  78.     "Cannot open this table."    /* PXERR_COULDNTOPENTBL */
  79. };
  80.  
  81. // Description -------------------------------------------------------------
  82. //
  83. //    These messages coorespond to error codes sent by PXEWIN.
  84. //
  85. // End ---------------------------------------------------------------------
  86.  
  87. // enum ERR_ORIGN //
  88.  
  89. enum ERR_ORIGIN
  90. {
  91.     ENG_ERROR,            /* Associated error comes from
  92.                        the engine error codes */
  93.     EWIN_ERROR            /* Error comes from PXEWIN associated
  94.                        error. */
  95. };
  96.  
  97. // Description -------------------------------------------------------------
  98. //
  99. //    This enum is used to identify the origin of the error.  Since the
  100. //    engine has it's own set of error codes and Borland may be adding
  101. //    a more extensive collection of errors in the future, it's probably
  102. //    best to seperate errors associated with this library from errors
  103. //    caused by engine function calls.  PXEWIN keeps track of this by
  104. //    using this enum to identify where the error came from.
  105. //
  106. // End ---------------------------------------------------------------------
  107.  
  108. // enum CLOSURE //
  109.  
  110. enum CLOSURE
  111. {
  112.     CLOSED,                /* On entering a constructor, CLOSURE
  113.                        is set.  If the operation within
  114.                        the constructor is successful,
  115.                        then OPENED is set.  */
  116.     OPENED
  117. };
  118.  
  119. // Description -------------------------------------------------------------
  120. //
  121. //    This sets the close_status of each operation to the correct value.
  122. //
  123. // End ---------------------------------------------------------------------
  124.  
  125. // struct DATES //
  126.  
  127. typedef struct DATES
  128. {
  129.     int day;            /* Julian day */
  130.     int month;            /* Julian month */
  131.     int year;            /* Julian year */
  132.     DATE date;            /* Raw long date data */
  133. }DATES;
  134. typedef DATES _FAR *PDATES;        /* DLL compatible DATES pointer */
  135.  
  136. // Description -------------------------------------------------------------
  137. //
  138. //    This structure is for encoding and decoding date data from the
  139. //    Paradox table.  It also provides a further type distinction between
  140. //    long numbers and DATE which are of the same type.
  141. //
  142. // End ---------------------------------------------------------------------
  143.  
  144. // Here are some addition DLL compatible pointer types you may/will need:
  145.  
  146. typedef double _FAR *Pdouble;
  147. typedef float _FAR *Pfloat;
  148. typedef long _FAR *Plong;
  149. typedef short _FAR *Pshort;
  150. typedef char _FAR **PPchar;
  151. typedef char (_FAR *ErrFunc)(void);    /* Engine Return error string
  152.                        function.  This will be set so
  153.                        that the correct error function
  154.                        is used depending on whether the
  155.                        error comes from the engine or
  156.                        PXEWIN. */
  157.  
  158. #endif // PXDEF_HPP //